<template>
  <div id="addUser">
      <AddAndUpdateTable @submitUserInfo="submitUserInfo" />
  </div>
</template>

<script>

import {
  createUserInfo
} from '@/assets/request/api.js';
import AddAndUpdateTable from './addAndUpdateTable.vue';

export default {
    name: "addUser",
    data() {
      return {};
    },
    methods: {
      submitUserInfo(userInfo) {

        console.log("新增用户",userInfo)

        createUserInfo(userInfo).then(res => {
            this.$message({
              message: '新增成功',
              type: "success"
            });
            this.$router.go(-1)
          }).catch(err => {
            this.$message({
              message: err.message,
              type: "error"
            });
          })
      }
    },
    components: { AddAndUpdateTable }
}
</script>

<style lang="scss" scoped>
</style>